home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK2.toast / Development Kits (Disc 2) / ScriptX / Code Samples / autofind / source / graphble.sx < prev    next >
Encoding:
Text File  |  1996-05-21  |  1.1 KB  |  47 lines  |  [TEXT/ttxt]

  1. --<<<
  2. -- Filename:
  3. --   graphble.sx
  4.  
  5. -- Other Files Required:
  6. --   axisprop.sx, traveler.sx
  7.  
  8. -- Purpose:
  9. --   Defines objects which can be displayed by the Grapher.
  10.  
  11. -- Specialized Classes:
  12. --   Graphable
  13.  
  14. -- Author:
  15. --   Ray Davis, based on work by Dionn Stewart, Steve Gano, and Steve Mayer
  16.  
  17. in module Autofinder
  18.  
  19. if (not isDefined Traveler) do fileIn theScriptDir name:"traveler.sx"
  20.  
  21. class Graphable (TwoDShape, Traveler, Dragger)
  22. class variables
  23.     axisProperties:(#())    -- keyed list of AxisProperties for object
  24. instance variables
  25.     tackPoint        -- graphing coordinates within object's shape
  26. end
  27.  
  28. method init self {class Graphable} #rest args #key \
  29.     thumbnail: tackPoint:(undefined) ->
  30. (
  31.     apply nextMethod self boundary:thumbnail fill:blackBrush args
  32.     makePurgeable thumbnail
  33.  
  34.     if tackPoint <> undefined then
  35.         self.tackPoint := tackPoint
  36.     else
  37.         self.tackPoint := new Point x:(self.width/2) y:(self.height/2)
  38.  
  39.     self.dropAction := (adata dragger offset ->
  40.         if dragger.presentedBy <> undefined do
  41.             graphObject dragger.presentedBy dragger
  42.     )
  43. )
  44.  
  45. "Compiled graphable.sx"
  46. -->>>
  47.